package com.fenghongzhang.day004;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

public class MyPlayer extends StandardGSYVideoPlayer {

    public MyPlayer(Context context, Boolean fullFlag) {
        super(context, fullFlag);
    }

    public MyPlayer(Context context) {
        super(context);
    }

    public MyPlayer(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public int getLayoutId() {
        return R.layout.myplayer_layout;
    }

    @Override
    protected void touchDoubleUp(MotionEvent e) {
//        super.touchDoubleUp(e);
        //点赞
    }

    @Override
    protected void touchLongPress(MotionEvent e) {
//        super.touchLongPress(e);
        //长按
        Toast.makeText(mContext, "长按", Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void init(Context context) {
        super.init(context);
        ImageView imageView = findViewById(R.id.heart);
        imageView.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(context, "哈哈", Toast.LENGTH_SHORT).show();
            }
        });
    }
}
